home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
LIBRARY
/
SWDOS12
/
TEXTPOS.ASM
< prev
next >
Wrap
Assembly Source File
|
1995-02-10
|
1KB
|
44 lines
;******************************************************************
;* TEXTPOS.ASM *
;* Source file for SoftWeyr enhanced DOS toolbox *
;* version 1.1 *
;* Copyright (c) by SoftWeyr,1994 *
;******************************************************************
.MODEL TPASCAL
include textrec.asm
.code
Public TextPos
TextPos Proc far F:Dword
les di,F
cmp es:[DI].TextRec.Mode,FMClosed
jnz @@1
mov AX,0FFFFH
mov dx,ax
jmp short @@4
@@1:mov AX,4201H
mov BX,ES:[DI].TextRec.Handle
Sub CX,CX
Mov DX,CX
INT 21H
jnc @@2
mov AX,0FFFFH
mov dx,ax
jmp short @@4
; {calculate the position of the logical file pointer}
@@2: Cmp ES:[DI].TextRec.Mode, FMOutput
JNZ @@3
Add AX,ES:[DI].TextRec.Bufpos
jnc @@4
Inc dx
jmp @@4
@@3: cmp ES:[DI].TextRec.BufEnd,0
jz @@4
mov cx,ES:[DI].TextRec.BufEnd
sub cx,ES:[DI].textRec.Bufpos
sub ax,cx
jnc @@4
dec dx
@@4: ret
endp
end